package com.jinxin.platform.cdflowchart.controller;

import com.jinxin.platform.base.common.pojo.JsonResult;
import com.jinxin.platform.cdflowchart.pojo.vo.TreeVO;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author: chenyinlong
 * @Description:
 * @Date: Create in 10:59 2021/10/12
 */
@RestController
@RequestMapping("/flowChart")
public class FlowChartController {


    @GetMapping("/getTree")
    public JsonResult getTree(){
        TreeVO treeVO = new TreeVO();
        treeVO.setName("铜仁区总表");
        treeVO.setValue("3213.12");
        List<TreeVO> one = new ArrayList<>();
        List<TreeVO> two = new ArrayList<>();

        TreeVO one1 = new TreeVO();
        one1.setName("综合楼");
        one1.setValue("123");
        TreeVO one2 = new TreeVO();
        one2.setName("附属");
        one2.setValue("123");
        TreeVO two1 = new TreeVO();
        two1.setName("综合楼");
        two1.setValue("123");
        TreeVO two2 = new TreeVO();
        two2.setName("附属");
        two2.setValue("123");
        two.add(two1);
        two.add(two2);
        one1.setChildren(two);

        one.add(one1);
        one.add(one2);


        treeVO.setChildren(one);

        return JsonResult.ok(treeVO);
    }


}
